package org.tang.springcloudvv.cxf.controller;

import com.alibaba.druid.support.json.JSONUtils;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j;
import org.apache.cxf.interceptor.PostInvokeInterceptor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.tang.springcloudvv.base.Result;
import org.tang.springcloudvv.cxf.feign.Springcloudvvuser;
import org.tang.springcloudvv.cxf.service.ProductService;
import org.tang.springcloudvv.cxf.vo.User;
import org.tang.springcloudvv.persistence.base.model.Product;

import java.util.List;

/**
 * <p><em>Created on 2021/12/1 5:44 下午</em></p>
 * webservice相关
 * @author fuzhongtang
 * @since 1.0.1
 */
@Slf4j
@RestController
public class WebserviceController {

    private final Logger logger = LoggerFactory.getLogger(getClass());


    @Autowired
    private ProductService productService;
    @Autowired
    private Springcloudvvuser springcloudvvuser;

    @PostMapping("/api/autoUserInfo/addUser")
    public User addUser(User user)
    {
        User user1 = new User();
        user1.setUserId(user.getUserId());
        user1.setUserName(user.getUserName()+"-from-Restful-Api-"+System.currentTimeMillis());
        user1.setAge(user.getAge());
        user1.setPhone(user.getPhone());
        return user1;
    }
}
